﻿@using BlueLotus7.Eden.KB.Models;
@using BlueLotus7.ArchiveSystem.Common;
@using BlueLotus7.Eden.Web.Models;
@using BlueLotus7.Eden.Web;
@model ControlViewModel<DomainScopeUser>
@{
    string panelId = Helper.GeneratePanelId("domainScopeUser", Model.Data);
    ViewFlags flags = ViewBag.Flags;
    bool canEdit = false, showOKButton = false;
    if (flags != null)
    {
        canEdit = flags[ViewFlags.CanEditFlag];
        showOKButton = flags[ViewFlags.ShowOKButtonFlag];
    }
}
<div id="@(panelId)" key="@(Model == null ? string.Empty : Model.Data.Key.ToString())" class="domainScopeUserPanel">
    <div class="field" name="DomainScopeKey" value="@(Helper.ConvertToHtmlDisplayString(Model.Data.DomainScope.Key))">
        <label>
            Domain Scope Key:
        </label>
        <span>@(Helper.ConvertToHtmlDisplayString(Model.Data.DomainScope.Key))</span>
    </div>
    <div class="field">
        <label>
            Domain Scope:
        </label>
        <span>@(Helper.ConvertToHtmlDisplayString(Model.Data.DomainScope.Name))</span>
    </div>
    <div class="field" name="ThirdPartyIdentity">
        <label>
            Identity:
        </label>
        <span class="readonly">@(Helper.ConvertToHtmlDisplayString(Model.Data.ThirdPartyIdentity))
        </span><span class="edit">
            <input type="text" value="@(Helper.ConvertToHtmlDisplayString(Model.Data.ThirdPartyIdentity))" />
        </span>
    </div>
    <div class="actionPanel">
        @{
            if (showOKButton)
            {
            <text> <a class="button btn-ok">OK</a></text> 
            }

            if (canEdit)
            {
            <text> <a class="button btn-edit">Edit</a><a class="button btn-submit">Save</a><a
                class="button btn-cancel">Cancel</a>
            </text> 
            }
        }
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        initBtnForDomainScopeUser();
    });
</script>
